package net.stogi.dsper.ui.client.module.user;

import net.stogi.dsper.api.dto.UserProfileDto;

import com.google.gwt.event.shared.GwtEvent;

public class OpenUserProfileEditorEvent extends GwtEvent<OpenUserProfileEditorHandler> {

	public static final GwtEvent.Type<OpenUserProfileEditorHandler> TYPE = new GwtEvent.Type<OpenUserProfileEditorHandler>();

	private UserProfileDto userProfile;

	public OpenUserProfileEditorEvent(UserProfileDto userProfile) {
		this.userProfile = userProfile;
	}

	@SuppressWarnings("unused")
	private OpenUserProfileEditorEvent() {}

	@Override
	public Type<OpenUserProfileEditorHandler> getAssociatedType() {
		return TYPE;
	}

	/**
	 * @return the userProfile
	 */
	public UserProfileDto getUserProfile() {
		return userProfile;
	}

	/**
	 * @param userProfile
	 *            the userProfile to set
	 */
	public void setUserProfile(UserProfileDto userProfile) {
		this.userProfile = userProfile;
	}

	@Override
	protected void dispatch(OpenUserProfileEditorHandler handler) {
		handler.onOpenUserProfileEditor(this);
	}
}
